Control units for the automotive field are generally used to control and monitor functions of the vehicle engine and/or additional electrical systems in the motor vehicle. Such a control device may be equipped with a non-volatile memory in order to store various operating variables, and the like, on a permanent basis, i.e., even if no supply voltage is applied, so that the control unit can access data from the past as well.
The memory addresses of such a nonvolatile memory are usually overwritten at time intervals, after a writing process to the address area, the respective memory cells normally having to be erased before values are able to be stored once again. Multiple writing in the same memory area may lead to damage to the respective memory cells, and to a considerable reduction in the service life of the nonvolatile memory. Erasing such a nonvolatile memory takes place, for example, by an erasing process in which all memory bits of the nonvolatile memory or of an addressed segment are put into a certain state, an erased state, in a suitable manner. When the appropriate address areas are read out (without prior writing). the erased state leads to a data pattern (designated below as erased data or as erased data pattern), for instance, to the output of logical “1”'s), so that, in the case of a simple reading out process of the address area, one is not able to recognize whether the address area previously had written in it data of a corresponding erased pattern or had not yet been written on.
Nonvolatile memories, such as flash memories, for use in control units, especially in the motor vehicle field, as a rule have data written in them at consecutive addresses. Address information concerning a starting address of the memory that is next to be written in may be recorded, in this instance, either by an appropriate address counter in a control unit, or by appropriate referencing data in a further area of the nonvolatile memory. In case of a fault, for instance, a failure of the power supply at the control unit, the content of the address counter in the control unit may be lost. If the failure in the power supply takes place between the writing of the data in a corresponding memory area of the nonvolatile memory and the writing of the appertaining referencing data, the memory area has already been written upon, but no referencing data have been stored to say that data have been written in the memory area. Consequently, when the control unit is next put into operation, it can only be determined, by analysis of the contents stored in the nonvolatile memory, beginning at which address the writing of data may be continued. That case is particularly critical in which a data pattern was last written in a corresponding memory area of the nonvolatile memory, that is before the occurrence of the fault, which corresponds to the erased pattern of the nonvolatile memory. When such a memory area is read out, it can therefore not be detected whether the corresponding memory area is in the erased state or had data written in it before the fault case corresponding to the erased data, and which would be read out from the corresponding memory area if this were in the erased state.
However, since a memory area in a nonvolatile memory, as used in such control units, is only able to be written in once, and an erasing process has first to be applied subsequently before a further writing process is able to be undertaken, it must consequently be assured that a memory area that has once been written upon is not written upon again.